<template>
  <el-form-item label="类型" prop="type">
    <el-select :disabled="disabled" :value="value" placeholder="请选择" @change="inputChange">
      <el-option v-if="type === 0" label="文件夹" value="FOLDER" key="FOLDER" />
      <el-option label="文件" value="FILE" key="FILE" />
    </el-select>
  </el-form-item>
</template>

<script lang="ts">
  import { Vue, Component, Model, Prop } from 'vue-property-decorator'
  import { EnumTypeOptions } from './index'

  @Component({
    name: 'ComEnumTypeSelect',
  })
  export default class CodeInput extends Vue {

    @Model('change', { type: String }) value!: string
    @Prop({ type: Number }) type!: EnumTypeOptions
    @Prop({ type: Boolean, default: false }) disabled!: boolean

    inputChange(text: string) {
      this.$emit('change', text)
    }
  }
</script>

<style scoped>

</style>
